from selenium.webdriver.common.by import By
from time import sleep
from one.lx4102.Base import Base

class Page(Base):
    djdlff=(By.XPATH,'/html/body/div[2]/div/div[1]/div/a[1]')
    def djdl(self):
        self.click(self.djdlff)
    dlzhff=(By.ID,'userName')
    def srzh(self):
        self.send_keys(self.dlzhff,'17733058407')
    dlmmff=(By.ID,'password')
    def dlmm(self):
        self.send_keys(self.dlmmff,'Li10140910')
    qrdlff=(By.NAME,'bi_Usuallogin')
    def qrdl(self):
        self.click(self.qrdlff)
    qdff=(By.ID,'bindSub')
    def qd(self):
        self.click(self.qdff)
    gt1=(By.XPATH,'/html/body/div[4]/div/div[2]/div[2]/p/a[6]')
    def gt(self):
        self.click(self.gt1)
    spym2=(By.XPATH,'/html/body/div[6]/div/div[2]/div[2]/a')
    def spym(self):
        self.click(self.spym2)
    jrgwc1=(By.XPATH,'//*[@id="layoutContain"]/div/div/div/div/div/map[1]/area')
    def jrgwc(self):
        self.click(self.jrgwc1)

    touzhi=(By.XPATH,'//*[@id="addToCartForDetail"]')
    def daohuo(self):
        self.click(self.touzhi)


    def luoji_login_01(self):
        self.open_url('https://www.jiuxian.com/')
        sleep(2)
        self.djdl()
        sleep(2)
        self.srzh()
        sleep(2)
        self.dlmm()
        sleep(10)
        self.qrdl()
        sleep(2)
        self.qd()
        sleep(2)
        self.gt()
        self.new_window()
        sleep(2)
        self.spym()
        self.new_window()
        sleep(4)
        self.jrgwc()
        sleep(5)
        self.new_window()
        self.daohuo()
        sleep(5)